<!-- "script/apps/Aries/Creator/Game/Login/CreateNewWorld.html" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>2009.8.2</title>
</head>
<body> 
<pe:mcml>
<script type="text/npl" refresh="false" src="CreateNewWorld.lua"><![CDATA[

local page = document:GetPageCtrl();
local MainLogin = commonlib.gettable("MyCompany.Aries.Game.MainLogin");

local CreateNewWorld = commonlib.gettable("MyCompany.Aries.Game.MainLogin.CreateNewWorld")
CreateNewWorld.page = page;
CreateNewWorld.OnInit();
local cur_mode = CreateNewWorld.init_mode;

function getBGStyle()
    return MyCompany.Aries.ExternalUserModule:GetConfig().game_login_bg or "";
end

function SelectedWorld(name,node)
    local world = node:GetPreValue("this", true);
    MyCompany.Aries.Game.MainLogin.CreateNewWorld.OnSelectWorld(world,true);
    --local selected = item.selected;

end

function ReturnLastStep()
    page:CloseWindow();
    NPL.load("(gl)script/apps/Aries/Creator/WorldCommon.lua");
    local WorldCommon = commonlib.gettable("MyCompany.Aries.Creator.WorldCommon")
    if(not WorldCommon.GetWorldInfo()) then
        MainLogin.state.IsLoadMainWorldRequested = nil;
        MainLogin:next_step();
    end
end

function GetAuthor(name)
    local s = "制作者:";
    if(name) then
        s = s..name;
    end
    return s;
end

function GetGameStyleDescription() 
    local style = CreateNewWorld.cur_style;
    local des = style.description;
    return des;
end

function GetGameDifficultyDescription()
    local grade = CreateNewWorld.cur_difficulty;
    local des = grade.description;
    return des;
end

function GetGameTerrainDescription()
    local terrain = CreateNewWorld.cur_terrain;
    local des = terrain.description;
    return des;
end



function GetCurWorldAuthor() 
    --return cur_world.author;
    return "None";
end

function GetCurWorldIP() 
    return "127.0.0.1";
end

function OnClickModify(name,node)
    local table_name = name;
    local node = page:GetNode(name);
    local s = string.gsub(table_name,"_info","");
    local cur_item = "cur_"..s;
    local index = CreateNewWorld[cur_item]["index"];
    local index = if_else(#CreateNewWorld[table_name] > index,(index + 1),1);
    CreateNewWorld[cur_item] = CreateNewWorld[table_name][index];
    page:Refresh(0.1);
end

function GetCurWorldMode()
    return CreateNewWorld.cur_style.show_value or "";
end

function GetCurWorldGrade() 
    return CreateNewWorld.cur_difficulty.show_value or "";
end
    
function GetTerrainBtnValue()
    return CreateNewWorld.cur_terrain.show_value or "";
end

function GetOneDayTimeBtnValue()
    return CreateNewWorld.cur_oneday_time.show_value or "";
end

local worldname = "默认名字2";
function GetWorldName()
    return worldname;
end

function OnWorldNameChange()
    worldname = Page:GetUIValue("new_world_name", "");
end
]]></script>

<pe:container alignment="_ct" style="position:relative;margin-left:-400px;margin-top:-250px;width:800px;height:450px;background:">
    <div style="width:800px;height:400px;">
        <div style="float:left;margin-top:8px;margin-left:27px;width:160px;height:384px;">
            <div style="width:160px;height:112px;">
                <div style="width:160px;height:112px;" class="mc_outer_panel">
                    <input type="button" value="单机模式" style="text-offset-y:-3;margin-top:19px;margin-left:15px;width:130px;height:34px;" class="mc_big_button_selected"/>
                    <input type="button" enabled="false" value="局域网模式" style="margin-top:10px;margin-left:15px;width:130px;height:34px;" class="mc_big_button"/>
                </div>
            </div>
            <div style="margin-top:16px;width:160px;height:256px;">
                <div style="width:160px;height:256px;" class="mc_outer_panel">
                    <div style="position:relative;float:left;margin-left:-48px;margin-top:-40px;width:256px;height:256px;">
                        <pe:mc_player name="MyPlayer" miniscenegraphname="AvatarMyselfTabCharacter" style="width:256px;height:256px;" IsInteractive="false"/>
                    </div>
                    <input type="button" enabled="false" value="更改造型" style="position:relative;margin-top:210px;margin-left:15px;width:130px;height:34px;" class="mc_big_button"/>
                </div>
            </div>
        </div>
        <div style="float:left;margin-top:8px;margin-left:38px;width:353px;height:384px;" class="mc_outer_panel">
            <div>
                <div style="position:relative;">
                    <div style="position:relative;margin-top:15px;font-size:16px;base-font-size:16;font-weight:bold;text-align:center;">
                        新的世界
                    </div>
                    <!--<div style="position:relative;margin-top:40px;margin-left:15px;font-size:16px;base-font-size:16;font-weight:bold;">
                    名称
                    </div>-->
                    <input  name="new_world_name"  value='<%=GetWorldName()%>' onkeyup="OnWorldNameChange" style="position:relative;margin-top:40px;margin-left:100px;width:150px;height:25px;font-size:18px;base-font-size:18;font-weight:bold;" class="mc_inner_panel"/>
                </div>
                <div style="position:relative;margin-top:100px;margin-left:25px;">
                    <div style="font-size:16px;base-font-size:16;font-weight:bold;">
                        模式
                    </div>
                    <input type="button" name="style_info" value="<%=GetCurWorldMode() %>" style="width:110px;height:30px;text-offset-y:-3"  class="mc_small_button" onclick="OnClickModify"/>
                    <div>
                        <%=GetGameStyleDescription() %>
                    </div>
                </div>
                <!--<div style="position:relative;margin-top:220px;margin-left:25px;">
                    <div style="font-size:16px;base-font-size:16;font-weight:bold;">
                        难度
                    </div>
                    <input type="button" name="difficulty_info" value="<%=GetCurWorldGrade() %>" style="width:110px;height:30px;text-offset-y:-3" class="mc_small_button" onclick="OnClickModify" />
                    <div>
                    </div>
                </div>-->
                <div style="position:relative;margin-top:100px;margin-left:180px;">
                    <div style="font-size:16px;base-font-size:16;font-weight:bold;">
                        地形
                    </div>
                    <input type="button" name="terrain_info" value="<%=GetTerrainBtnValue() %>" style="width:110px;height:30px;text-offset-y:-3" onclick="OnClickModify" class="mc_small_button"/>
                    <div>
                        <%=GetGameTerrainDescription() %>
                    </div>
                </div>
                <!--<div style="position:relative;margin-top:220px;margin-left:180px;">
                    <div style="font-size:16px;base-font-size:16;font-weight:bold;">
                        每日时间
                    </div>
                    <input type="button" value="<%=GetOneDayTimeBtnValue() %>" name="oneday_time_info" style="width:110px;height:30px;text-offset-y:-3" onclick="OnClickModify" class="mc_small_button"/>
                    <div>
                    </div>
                </div>-->
            </div>
        </div>
        <div style="float:left;margin-top:8px;margin-left:27px;width:160px;height:384px;" class="mc_outer_panel">
            <div style="margin-top:22px;margin-left:15px;width:130px;height:100px;" class="mc_inner_panel">
                <div style="position:relative;font-size:16px;base-font-size:16;font-weight:bold;margin-top:15px;margin-left:20px;">
                    0%
                </div>
                <div style="position:relative;font-size:13px;margin-top:20px;margin-left:65px;">
                    完成度
                </div>
                <div style="text-align:center;font-size:13px;margin-top:45px;margin-left:4px;">
                创作时间长
                </div>
                <div style="text-align:center;font-size:13px;margin-top:3px;margin-left:6px;">
                0天0小时0分钟
                </div>
            </div>
            <div style="margin-top:22px;margin-left:15px;width:130px;height:100px;" class="mc_inner_panel">
                <div style="margin-top:7px;">
                    <font style ="font-size:14px;base-font-size:14;font-weight:bold;text-align:center;">模式</font><br/>
                    <font style ="font-size:13px;text-align:center;"><%=GetCurWorldMode() %></font><br/>
                    <font style ="font-size:14px;base-font-size:14;font-weight:bold;text-align:center;">难度</font><br/>
                    <font style ="font-size:13px;text-align:center;"><%=GetCurWorldGrade()%></font>
                </div>
                    
            </div>
            <div style="margin-top:22px;margin-left:15px;width:130px;height:100px;" class="mc_inner_panel">
                <div style="margin-top:7px;">
                    <font style ="font-size:14px;base-font-size:14;font-weight:bold;text-align:center;">作者</font><br/>
                    <font style ="font-size:13px;text-align:center;"><%=GetCurWorldAuthor() %></font><br/>
                    <font style ="font-size:14px;base-font-size:14;font-weight:bold;text-align:center;">IP地址</font><br/>
                    <font style ="font-size:13px;text-align:center;"><%=GetCurWorldIP() %></font>
                </div>
            </div>
        </div>
    </div>
    <div style="width:800px;height:30px;margin-top:20px;margin-left:120px;">
        <input type="button" value="创建新世界" style="font-weight:bold;margin-left:38px;height:32px;width:120px;" class="mc_big_button" onclick="MyCompany.Aries.Game.MainLogin.CreateNewWorld.OnClickCreateWorld"/>
        <input type="button" value="返回" style="margin-left:186px;height:32px;width:120px;" class="mc_big_button" onclick="ReturnLastStep"/>
    </div>
</pe:container>
</pe:mcml>
</body>
</html>